package com.sneakxy.cloudbase.platform.controller;

import java.net.URI;

import org.springframework.http.HttpStatus;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import reactor.core.publisher.Mono;

@Controller
public class WelcomeController {

	@GetMapping("/")
    public Mono<Void> index(ServerHttpResponse response){
        return Mono.fromRunnable(()->{
            response.setStatusCode(HttpStatus.FOUND);
            response.getHeaders().setLocation(URI.create("/index.html"));
        });
    }
	
}
